package io.finer.erp.jeecg.bas.service.impl;

import io.finer.erp.jeecg.bas.entity.ZrkTs;
import io.finer.erp.jeecg.bas.entity.ZrkTsources;
import io.finer.erp.jeecg.bas.mapper.ZrkTsourcesMapper;
import io.finer.erp.jeecg.bas.mapper.ZrkTsMapper;
import io.finer.erp.jeecg.bas.service.IZrkTsService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 客户投诉记录
 * @Author: jeecg-boot
 * @Date:   2020-08-20
 * @Version: V1.0
 */
@Service
public class ZrkTsServiceImpl extends ServiceImpl<ZrkTsMapper, ZrkTs> implements IZrkTsService {

	@Autowired
	private ZrkTsMapper zrkTsMapper;
	@Autowired
	private ZrkTsourcesMapper zrkTsourcesMapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		zrkTsourcesMapper.deleteByMainId(id);
		zrkTsMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			zrkTsourcesMapper.deleteByMainId(id.toString());
			zrkTsMapper.deleteById(id);
		}
	}
	
}
